<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <link rel="shortcut icon" href="../../src/images/bitbug_favicon.ico" type="image/x-icon">
  <meta name="keywords" content="your keywords">
  <meta name="description" content="your description">
  <meta name="author" content="author,email address">
  <meta name="robots" content="index,follow">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <title>仁和区党群服务一号通暨群众意见受理中心</title>
  <link rel="stylesheet" href="../../src/css/base.css">
  <link rel="stylesheet" href="../../src/css/common.css">
  <link rel="stylesheet" href="../../src/css/tpl.css">
  <link rel="stylesheet" href="../../src/css/user_center.css">
    <script src="../../src/js/libs/es5-shim.min.js"></script>   <script src="../../src/js/libs/es5-sham.min.js"></script>    <script src="../../src/js/libs/json3.min.js"></script> </head>

<body>
  <div class="page">
    <div id="header">
    </div>
    <div class="menu-bar">
      <div class="container">
        <span>
        <span class="crumb-name">当前你的位置：</span>>
        </span>
        <span>
             <a href="../Home/Index.html">首页</a>>
      </span>
        <span>个人中心</span>
      </div>
    </div>

    <div class="mid_container clearfix">
      <div class="left_guide">
        <h1 class="left_guide_top_size">
          个人中心
        </h1>
        <div class="left_guide_decorate">
        </div>
        <div class="left_about_us">
          ABOUT US
        </div>
        <div class="left_white_about ">
          <a href="../Personal/LeaveMessage.html">
              <span class="left_cn_about_us">系统消息</span>
            </a>
        </div>
        <div class="left_white_about">
          <a href="../Personal/Collect.html">
              <span class="left_cn_about_us">我的收藏</span>
            </a>
        </div>
        <div class="left_white_about active">
          <a href="../Personal/Work.html">
              <span class="left_cn_about_us">我的工作</span>
            </a>
        </div>
        <div class="left_white_about">
          <a href="../Personal/set.html">
              <span class="left_cn_about_us">修改密码</span>
            </a>
        </div>
      </div>
      <div class="mid_guide">
        <div class="mid_guide_content tabs">
          <div class="title">
            <div class="tab-item">
              <ul>
                <li class="active" typeid="0">全部</li>
                <li typeid="7">待处理</li>
                <li typeid="8">已处理</li>
              </ul>
            </div>
          </div>
          <div class="content" id="list_html">
          </div>
          <div id="page1" class="laypage"></div>
        </div>
      </div>
    </div>
  </div>
  <div id="footer"></div>
  <script type="text/html" id="list_tpl">
    {{each resultdata val idx}}
    <div class="work_content_item">
      <div class="row_1 clearfix">
        <span class="fl">投诉编号：{{val.id}}</span>
        <span class="fr">{{val.status | _status}}</span>
      </div>
      <div class="row_2 clearfix">
        {{if val.picurls.length !== 0}}
        <img class="fl" src="{{val.picurls[0].smallpic}}" width="70" height="70"> {{/if}} {{if val.picurls.length == 0}}
        <img class="fl" src="../../src/images/p_3.png" alt=""> {{/if}}
        <div class=" fl row_2_mid">
          <div class="title">{{val.title}}</div>
          <div class="date">{{val.createtime}}</div>
        </div>
        <div class="fr row_2_r">
          {{if val.status == 7}}
          <a href="../Personal/WorkAudit.html?{{val.id}}">
            去处理
          </a> {{else}}
          <a href="../Personal/WorkIndex.html?{{val.id}}">
              详情
            </a> {{/if}}
        </div>
      </div>
    </div>
    {{/each}} {{if resultdata.length === 0}}
    <div class="empty_box">
      <img src="../../src/images/null_state.png" alt="">
    </div>
    {{/if}}
  </script>
  <script src="../../src/js/libs/jquery.1.12.4.js"></script>
  <script src="../../src/js/libs/template-web.js"></script>
  <script src="../../src/js/libs/laypage/laypage.js"></script>
  <script src="../../src/js/base/common.js"></script>
  <script>
    var params = {
      id: document.cookie.split(";")[1].split("=")[1],
      page: 1,
      statusid: '0'
    }
    var pageindex = 6    

    $('.tab-item li').on('click', function () {
      params.statusid = $(this).attr('typeid')
      $(this).addClass('active').siblings().removeClass('active')
      getList(params, params.page)
    })

    getList(params, params.page)

    function getList(params, page) {
      $.ajax({
        url: 'http://221.10.2.222:5680/api/w1/Consumers/MyWorkPc2/' + params.id + "/" + page + "/" +
          params.statusid,
        type: "GET",
        dataType: "json",
        success: function (res) {
          console.log(res)
          res.resultdata = JSON.parse(res.resultdata)
          var list = template('list_tpl', res)
          $('#list_html').html(list)
          laypage({
            cont: 'page1', //容器。值支持id名、原生dom对象，jquery对象。【如该容器为】：<div id="page1"></div>
            pages: Math.ceil(res.count / 5), //通过后台拿到的总页数
            curr: page || 1, //当前页
            first: false,
            last: false,
            prev: '<',
            next: '>',
            jump: function (obj, first) {
              window.scrollTo(0, 300)
              if (!first) {
                getList(params, obj.curr);
              }
            }
          });
        }
      })
    }

    template.defaults.imports._status = function (val) {
      var arr = ['待处理', '待审核', '处理中', '待评价', '已完结', '已取消', '网格化管理员待处理', '网格化管理员已处理', '审核失败']
      val = parseInt(val) - 1
      return arr[val] ? arr[val] : '其他'
    };
  </script>
</body>

</html>